package com.ly.heart.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ly.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.ly.heart.mapper.MaterialInventoryMapper;
import com.ly.heart.domain.MaterialInventoryEntity;

import javax.annotation.Resource;
import com.ly.heart.service.IMaterialInventoryService;

/**
 * 物料库存信息Service业务层处理
 * 
 * @author wutao
 * @date 2024-07-04
 */
@Service
public class MaterialInventoryServiceImpl extends ServiceImpl<MaterialInventoryMapper, MaterialInventoryEntity> implements IMaterialInventoryService {

    @Resource
    private MaterialInventoryMapper materialInventoryMapper;

    /**
     * 查询物料库存信息
     * 
     * @param id 物料库存信息ID
     * @return 物料库存信息
     */
    @Override
    public MaterialInventoryEntity selectMaterialInventoryById(String id)
    {
        return materialInventoryMapper.selectMaterialInventoryById(id);
    }

    /**
     * 查询物料库存信息列表
     * 
     * @param materialInventory 物料库存信息
     * @return 物料库存信息
     */
    @Override
    public List<MaterialInventoryEntity> selectMaterialInventoryList(MaterialInventoryEntity materialInventory)
    {
        return materialInventoryMapper.selectMaterialInventoryList(materialInventory);
    }

    /**
     * 新增物料库存信息
     * 
     * @param materialInventory 物料库存信息
     * @return 结果
     */
    @Override
    public int insertMaterialInventory(MaterialInventoryEntity materialInventory)
    {
        materialInventory.setCreateTime(DateUtils.getNowDate());
        return materialInventoryMapper.insertMaterialInventory(materialInventory);
    }

    /**
     * 修改物料库存信息
     * 
     * @param materialInventory 物料库存信息
     * @return 结果
     */
    @Override
    public int updateMaterialInventory(MaterialInventoryEntity materialInventory)
    {
        materialInventory.setUpdateTime(DateUtils.getNowDate());
        return materialInventoryMapper.updateMaterialInventory(materialInventory);
    }

    /**
     * 批量删除物料库存信息
     * 
     * @param ids 需要删除的物料库存信息ID
     * @return 结果
     */
    @Override
    public int deleteMaterialInventoryByIds(String[] ids)
    {
        return materialInventoryMapper.deleteMaterialInventoryByIds(ids);
    }

    /**
     * 删除物料库存信息信息
     * 
     * @param id 物料库存信息ID
     * @return 结果
     */
    @Override
    public int deleteMaterialInventoryById(String id)
    {
        return materialInventoryMapper.deleteMaterialInventoryById(id);
    }
}
